//
//  HNStrengtheningClassApplicationModel.m
//  优学荟管理系统
//
//  Created by edz on 2017/11/25.
//  Copyright © 2017年 星道三好. All rights reserved.
//

#import "HNStrengtheningClassApplicationModel.h"

@implementation HNStrengtheningClassApplicationModel

// 实例化
- (instancetype)init_ValuForKeyWithDict:(NSDictionary *)Dict {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:Dict];
    }
    return self;
}

// KVC
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    if ([key isEqualToString:@"id"]) {
        
        self.ID = value;
    }
    
    if ([key isEqualToString:@"user"]) {
        
        self.username = value[@"username"];
        self.petName = value[@"petName"];
    }
    
    if ([key isEqualToString:@"trainLesson"]) {
        
        self.name = value[@"name"];
        self.trainLessonID = value[@"id"];
    }
    
    if ([key isEqualToString:@"applyElements"]) {
        
        [value enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            
           [self.ApplyElementArr addObject:[[HNStrengtheningApplicationApplyElementModel alloc] init_ValuForKeyWithDict:obj]];
        }];
    }
    
    if ([key isEqualToString:@"orgElements"]) {
        
        [value enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
           
            [self.OrgElementArr addObject:[[HNCourseListChartsModel alloc] init_ValuForKeyWithDict:obj]];
        }];
    }
}

- (NSMutableArray<HNStrengtheningApplicationApplyElementModel *> *)ApplyElementArr {
    
    if (!_ApplyElementArr) {
        
        _ApplyElementArr = [NSMutableArray array];
    }
    return _ApplyElementArr;
}

- (NSMutableArray<HNCourseListChartsModel *> *)OrgElementArr {
    
    if (!_OrgElementArr) {
        
        _OrgElementArr = [NSMutableArray array];
    }
    return _OrgElementArr;
}
@end
